package demo3;

interface IShape {
//    //public static final int a = 10;
//    int a = 0;
//    //public abstract void draw();
    void draw();
//    //构造方法
//    public IShape() {
//
//    }
//    //代码块
//    {
//
//    }
//    default public void test() {
//        System.out.println("test()");
//    }
//    public static void test2() {
//        System.out.println("static方法");
//    }
}
class Rect implements IShape {
    @Override
    public void draw() {
        System.out.println("矩形");
    }
}
class Flower implements IShape {
    @Override
    public void draw() {
        System.out.println("❀");
    }
}

public class Test8_4 {
    public static void drawMap(IShape iShape) {
        iShape.draw();
    }
    public static void main(String[] args) {
        //IShape iShape = new IShape();
        IShape iShape = new Rect();
        drawMap(iShape);
        drawMap(new Flower());
    }
}
